<template>
  <a-config-provider
    :locale="locale"
    :theme="{
      token: {
        colorPrimary: data.colorPrimary,
      },
    }"
  >
    <router-view v-slot="{ Component }">
      <keep-alive>
        <component :is="Component" v-if="$route.meta.keepAlive" />
      </keep-alive>
      <component :is="Component" v-if="!$route.meta.keepAlive" />
    </router-view>
  </a-config-provider>
</template>
<script setup>
import { ref } from "vue";
import { theme } from "ant-design-vue";
import zhCN from "ant-design-vue/es/locale/zh_CN";
import dayjs from "dayjs";
import "dayjs/locale/zh-cn";
dayjs.locale("zh-cn");
const defaultData = {
  colorPrimary: "#1677ff",
};
const locale = ref(zhCN);
const data = ref(defaultData);
const { token } = theme.useToken();
</script>
